package com.jadcon.harveycedars.model.dormitory;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;

public class Dormitory {

	private List<Room> roomList = new ArrayList<Room>();
	private String name;
	private String note;
	private boolean isMale;
	private boolean hasAirCondition;
	private boolean includesContinentalBreakfast;
	private boolean HandicapAccessible;
	private long id;

	// Default (zero parameter) constructor
	public Dormitory() { }
	
	// constructor for Dormitory
	public Dormitory(long id, String name) {
		this.id = id;
		this.name = name;
	}

	public List<Room> getRoomList() {
		return roomList;
	};
	
	public void setRoomList(List<Room> roomList) {
		this.roomList = roomList;
	};
	
	public int getNumberOfRooms() {
		return roomList.size();
	}
	
	public int getBedsAvailable() {
		int getTotalBedsAvailable = 0;
		for (Room room : roomList) {
			getTotalBedsAvailable = getTotalBedsAvailable + room.getBedsAvailable();
		}
		return getTotalBedsAvailable;
	}

	public int getTotalGuest() {
		int getTotalGuests = 0;
		for (Room room : roomList) {
			getTotalGuests = getTotalGuests + room.getTotalGuests();
		}
		return getTotalGuests;
	}
	
	public int getTotalBeds() {
		int getTotalBeds = 0;
		for (Room room : roomList) {
			getTotalBeds = getTotalBeds + room.getTotalBeds();
		}
		return getTotalBeds;
	}
	
	

	public void addRoom(Room room) {
		roomList.add(room);
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public boolean isMale() {
		return isMale;
	}

	public void setMale(boolean isMale) {
		this.isMale = isMale;
	}
	
	public boolean isHasAirCondition() {
		return hasAirCondition;
	}

	public void setHasAirCondition(boolean hasAirCondition) {
		this.hasAirCondition = hasAirCondition;
	}

	public boolean isIncludesContinentalBreakfast() {
		return includesContinentalBreakfast;
	}

	public void setIncludesContinentalBreakfast(boolean includesContinentalBreakfast) {
		this.includesContinentalBreakfast = includesContinentalBreakfast;
	}

	public boolean isHandicapAccessible() {
		return HandicapAccessible;
	}

	public void setHandicapAccessible(boolean handicapAccessible) {
		HandicapAccessible = handicapAccessible;
	}

	public String toString() {
		 return ToStringBuilder.reflectionToString(this);
	}

}
